home *** CD-ROM | disk | FTP | other *** search
/ Sound Fx / Sound Fx.iso / Software / UNZIPED / MPW181-5 / _SETUP.1 / mutx_imp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-04-19  |  625 b   |  39 lines

  1. /* mutx_imp.h
  2.  
  3.    Mutex locking and unlocking implementation for the operating
  4.    system you are porting to. The _Mutex type is defined in
  5.    "all.h". */
  6.  
  7. #ifndef THREAD_IMP_H
  8. #define THREAD_IMP_H
  9.  
  10. #ifdef SEEK_STOP
  11.  
  12. #ifdef __WIN32__
  13. #include <windows.h>
  14. #endif // __WIN32__
  15.  
  16. #include "all.h"
  17.  
  18. inline uint32 mtx_lock(_Mutex m)
  19. {
  20. #ifdef __WIN32__
  21.     return(WaitForSingleObject(m, INFINITE));
  22. #else
  23.     // lock mutex
  24. #endif // __WIN32__
  25. }
  26.  
  27. inline uint32 mtx_unlock(_Mutex m)
  28. {
  29. #ifdef __WIN32__
  30.     return(ReleaseMutex(m));
  31. #else
  32.     // unlock mutex
  33. #endif // __WIN32__
  34. }
  35.  
  36. #endif  // SEEK_STOP
  37.  
  38. #endif
  39.